/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package kotionokyurievna.gmail.com.circlebuffer.logic;

/**
 *
 * @author Kateryna_Reznik
 */
public class Consumer implements Runnable {
    private CircularBuffer cBuffer;

    public Consumer(CircularBuffer cBuffer) {
        this.cBuffer = cBuffer;
    }

    public void run() {
        while ( true ){
            System.out.println( cBuffer.get());
            try {
                Thread.sleep(2);
            } 
            catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
